home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _A4B87934B0C649FB9CF0630DA6CE77A6 < prev    next >
Encoding:
Text File  |  2004-01-06  |  2.6 KB  |  72 lines

  1. --------------------------------------------------
  2. --    Created By: Petar
  3.  
  4.  
  5. AIBehaviour.ChimpAttack = {
  6.     Name = "ChimpAttack",
  7.  
  8.  
  9.     ---------------------------------------------
  10.     OnPlayerSeen = function( self, entity, fDistance )
  11.         -- called when the enemy sees a living player
  12.         entity:SelectPipe(0,"abberation_attack");
  13.         entity:InsertSubpipe(0,"DropBeaconAt");
  14.     
  15.     end,
  16.     ---------------------------------------------
  17.     OnEnemyMemory = function( self, entity )
  18.         -- called when the enemy can no longer see its foe, but remembers where it saw it last
  19.     end,
  20.     ---------------------------------------------
  21.     OnInterestingSoundHeard = function( self, entity )
  22.         -- called when the enemy hears an interesting sound
  23.         entity:InsertSubpipe(0,"DropBeaconAt");
  24.     end,
  25.     ---------------------------------------------
  26.     OnThreateningSoundHeard = function( self, entity )
  27.         -- called when the enemy hears a scary sound
  28.         entity:InsertSubpipe(0,"DropBeaconAt");
  29.     end,
  30.     ---------------------------------------------
  31.     OnReload = function( self, entity )
  32.         -- called when the enemy goes into automatic reload after its clip is empty
  33.     end,
  34.     ---------------------------------------------
  35.     OnGroupMemberDied = function( self, entity )
  36.         -- called when a member of the group dies
  37.     end,
  38.     ---------------------------------------------
  39.     OnNoHidingPlace = function( self, entity, sender )
  40.         -- called when no hiding place can be found with the specified parameters
  41.     end,    
  42.     ---------------------------------------------
  43.     OnReceivingDamage = function ( self, entity, sender)
  44.         entity:InsertSubpipe(0,"chimp_hurt");
  45.     end,
  46.     --------------------------------------------------
  47.     OnBulletRain = function ( self, entity, sender)
  48.         -- called when the enemy detects bullet trails around him
  49.     end,
  50.     --------------------------------------------------
  51.     OnCloseContact = function ( self, entity, sender)
  52.         if (entity.MELEE_ANIM_COUNT) then
  53.             local rnd = random(1,entity.MELEE_ANIM_COUNT);
  54.             local melee_anim_name = format("attack_melee%01d",rnd);
  55.             entity:InsertSubpipe(0,"jump_decision");
  56.             entity:InsertAnimationPipe(melee_anim_name,3,nil,0);
  57.         else
  58.             Hud:AddMessage("==================UNACCEPTABLE ERROR====================");
  59.             Hud:AddMessage("Entity "..entity:GetName().." made melee attack but has no melee animations.");
  60.             Hud:AddMessage("==================UNACCEPTABLE ERROR====================");
  61.         end
  62.     end,
  63.  
  64.  
  65.     --------------------------------------------------
  66.     SWITCH_TO_ABBERATION_ATTACK = function ( self, entity, sender)
  67.         entity:SelectPipe(0,"abberation_attack");
  68.     end,
  69.     --------------------------------------------------
  70.  
  71.  
  72. }